package com.geekhole.demo.v1;

import com.geekhole.demo.view.OrderView;
import com.geekhole.demo.view.OrderViewApplication;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.List;

abstract class AbstractOrderViewApplication {
    @Test
    void getByUserId() {
        long start = System.currentTimeMillis();
        List<OrderView> byUserId = getOrderViewApplication().getByUserId(1L);
        Assertions.assertNotNull(byUserId);
        Assertions.assertFalse(byUserId.isEmpty());
        long end = System.currentTimeMillis();
        System.out.println(String.format("cost %s ms data is %s", end - start, byUserId));
    }

    protected abstract OrderViewApplication getOrderViewApplication();
}
